package com.teach.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.teach.dto.HotelOrderDTO;
import com.teach.entity.HotelRoomOrder;

public interface HotelRoomOrderMapper {
    int deleteByPrimaryKey(Long orderId);

    int insert(HotelRoomOrder record);

    int insertSelective(HotelRoomOrder record);

    HotelRoomOrder selectByPrimaryKey(Long orderId);

    int updateByPrimaryKeySelective(HotelRoomOrder record);

    int updateByPrimaryKey(HotelRoomOrder record);
    
    @Select("select * from hotel_room_order")
	List<HotelRoomOrder> selectAll();
    
    @Select("SELECT A.order_id,A.USER_NAME,A.order_price,A.shop_id,B.room_type_name,A.order_status,A.order_create_time from hotel_room_order as A INNER JOIN hotel_room_type as B on A.room_type_id=B.room_type_id and USER_NAME=#{userName}")
	List<HotelOrderDTO> selectByUserName(String userName);
    
    @Select("SELECT A.order_id,A.USER_NAME,A.order_price,A.shop_id,B.room_type_name,A.order_status,A.order_create_time from hotel_room_order as A INNER JOIN hotel_room_type as B on A.room_type_id=B.room_type_id and shop_id=#{shopId}")
   	List<HotelOrderDTO> selectByshopId(Long shopId);
    
    @Select("SELECT A.order_id,A.USER_NAME,A.order_price,A.shop_id,B.room_type_name,A.order_status,A.order_create_time from hotel_room_order as A INNER JOIN hotel_room_type as B on A.room_type_id=B.room_type_id")
    List<HotelOrderDTO> select();
}